package net.oschina.archx.spring;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Application
 *
 * @author Archx
 * @date 2015/6/23 0023
 */
public class Application implements ServletContextAware {

    private static ServletContext context;

    @Override
    public void setServletContext(ServletContext servletContext) {
        Application.context = servletContext;
    }

    /**
     * 获取物理路径
     *
     * @param path
     * @return
     */
    public static String getRealPath(String path) {
        return context.getRealPath(path);
    }
}
